export function uploadFileApi(header, callback) {

    var formData = new FormData();
    formData.append("file", file);
    $.ajax({
        url: header.fileHost + '/storage/create',
        type: "post",
        data: formData,
        contentType: false,
        processData: false,
        success: function(data) {
            console.log(JSON.stringify(data, null, 2))
            if (data.code == 200) {
                callback.success(data.data)
            } else {
                callback.fail(data.msg)
            }
        },
        error: function(xhr, errorType, error) {
            //   console.log("网络错误")
            callback.fail("网络错误")
        }
    });
}